Does jQuery ajaxSetup({cache: true}) generally work?

Posted by fsb on Stack Overflow See other posts from Stack Overflow or by fsb
Published on 2010-05-04T13:05:02Z Indexed on 2010/05/04 13:08 UTC
Read the original article Hit count: 702

Filed under:
|
|

jQuery 1.4.2 omits the timestamp GET parameter (to defeat browser cacheing) if I assert the ajax cache setting in the local context:

$.ajax({
    url: searcher, 
    data: keys,
    cache: true,
    type: 'GET',
    dataType: 'json',
    success: function(data) {
        // something
    });

But it includes timestamp if I move the setting out of there and into the global context:

$.ajaxSetup({cache: true});

Moreover, if I let the default apply, jQuery sets timestamp, which doesn't seem to match the manual.

Do you experience the same?

Do HTTP cache control response headers from the server affect this jQuery feature?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX